#!/bin/bash

NumB=`grep "\->" result.output |wc -l`
NumC=`grep "MPT" result.output |wc -l`
NumE=`grep "FPT" result.output |wc -l`

grep "\->" result.output |awk '{printf("%9.4f\n",$5)}'>bindingInput.dat  ##Binding
#grep "MPT" result.output |awk '/[0-9]$/ {printf("%9.4f\n",$NF)}'>captureInput.dat  ##Capture
grep "MPT" result.output |awk '{printf("%9.4f\n",$NF)}'>captureInput.dat  ##Capture
grep "FPT" result.output |awk '{printf("%9.4f\n",$3)}'>evolutionInput.dat  ##Evolution

  echo "binding rate: "
 /home/rhome/wangyong/zhaolingci_io4/Go-DCL1-A/ana/kinetic/Rate.x $NumB bindingInput.dat
  echo "capture rate: "
 /home/rhome/wangyong/zhaolingci_io4/Go-DCL1-A/ana/kinetic/Rate.x $NumC captureInput.dat
  echo "evolution rate: "
 /home/rhome/wangyong/zhaolingci_io4/Go-DCL1-A/ana/kinetic/Rate.x $NumE evolutionInput.dat
